<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>自定义指令</title>
<title>ngMessage</title>
<link rel="stylesheet" href="../lib/bootstrap3/css/dashboard.css">
<link rel="stylesheet" href="../lib/bootstrap3/css/bootstrap-theme.css">
<link rel="stylesheet" href="../lib/bootstrap3/css/bootstrap.min.css">
<script src="../lib/jquery/jquery-1.10.2.js"></script>
<script src="../lib/bootstrap3/js/bootstrap.min.js"></script>
<script src="../lib/angularjs/angular.min.js"></script>
<script src="../lib/angularjs/angular-messages.min.js"></script>
</head>
<body ng-app="customDirectiveApp">
    <my-directive>1</my-directive>
</body>
<script>
    var app=angular.module("customDirectiveApp",[]);
    app.directive("myDirective",myDirective);
    function myDirective() {
        return {
            restrict:'E',
            template:'<a href="http://www.baidu.com">打开百度</a>'
        };
    }
</script>
</html>